<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <input type="button" value="中文" @click="changeLang('zh')" >
        <input type="button" value="english"  @click="changeLang('en')" >
        <hr/>
        <h1>{{$info('title')}}</h1>
        <p>
            {{$info('username')}}:<input type="text" v-model="username"/>
        </p>
        <p>
            {{$info('userpass')}}:<input type="password" v-model="userpass"/>
        </p>
        <p>
            {{$info('userpass2')}}:<input type="password" v-model="userpass2" />
        </p>
        <p>
            <input type="button" :value="$info('regButton')" @click="regSave">
        </p>
    </div>
</body>

</html>
<script src="./js/vue.global.js"></script>
<script src="./js/myI18n.js"></script>
<script src="./js/i18n.js"></script>
<script>

    const {createApp} = Vue;
    
    let app = createApp({
        components:{},
        data(){
            return {
                language:"zh",
                pagename:"reg",
                username:"",
                userpass:"",
                userpass2:""               
            }
        },
        methods:{
            changeLang(language){
                this.language = language;
            },
            regSave(){
                console.log("regSave");
                if(this.userpass!=this.userpass2){
                    alert(this.$info('errMsgPass'));
                }
            }
        }  
    });

    // 安装一个插件
    app.use(myI18n,{
        uIObj
    });

    app.mount("#app");


</script>